<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>test1</title>
    <script type="text/javascript" src="../js/angular.min.js"></script>
</head>
<body >
    <div ng-app="myapp" ng-controller="myctrl" >
        <div >
            <input type="text" name="name" ng-model="name"/>
            <input type="button" value="清空" ng-click="clear()">
        </div>
        <div >
            hello, {{name}}
        </div>
    </div>
    <script type="text/javascript">
        var myapp = angular.module("myapp",[]);
        myapp.controller("myctrl",["$scope",function($scope){
            $scope.name="黑马程序员";
            $scope.clear=function () {
                $scope.name = "传智播客";
            }
            }]);
    </script>

</body>
</html>